/*
 * Copyright (C) 2019-2020 Alibaba Group Holding Limited
 */

#include <string.h>
#include <aos/cli.h>
#include <aos/kernel.h>
#include <uservice/uservice.h>

#define HELP_INFO "reboot system"

void cmd_reboot_func(char *wbuf, int wbuf_len, int argc, char **argv)
{
    if (argc == 1) {
        aos_reboot();
    } else {
        printf("%s\r\n", HELP_INFO);
    }
}

void cli_reg_cmd_reboot(void)
{
    static const struct cli_command cmd_info = {
        "reboot",
        HELP_INFO,
        cmd_reboot_func
    };

    aos_cli_register_command(&cmd_info);
}
